#ifndef __ZEN_MATERIAL_HPP__
#define __ZEN_MATERIAL_HPP__

#include <map>

#include <string.h>
#include <JSL.hpp>

#include "../math.hpp"

#include "Texture.hpp"
#include "TextureManager.hpp"

namespace zen {

	namespace video {


		class Material {

		public:
			
			std::string name;
			glm::vec4 color;
			glm::vec4 ambient;
			glm::vec4 diffuse;
			glm::vec4 specular;
			glm::vec4 emission;
			float shininess;
			PTexture texture;

			Material();
			Material(const Material &other);
			Material(const std::string &name, const glm::vec4 &ambient, const glm::vec4 &diffuse, const glm::vec4 &specular, const glm::vec4 &emission, float shininess, const PTexture &texture);

			Material& operator = (const Material &other);

			void activate(GLenum face = GL_FRONT_AND_BACK) const;

			bool loadResource(const jsl::Node *node, TextureManager* textureManager);

			bool saveResource(jsl::Node *node);


		};


	} // namespace video

} // namespace zen

#endif // __ZEN_MATERIAL_HPP__
